<?php

namespace App\Trip\Enums\Scenic;


use App\Services\Scenic\Order\ScenicOrderFactoryInterface;
use App\Services\Scenic\Query\ScenicQueryFactoryInterface;
use App\Services\Scenic\ScenicOrderFactory;
use App\Services\Scenic\ScenicQueryFactory;

enum ScenicProvider: string
{
    //统一使用小写
    case LOCAL = 'local';
    case TUNIU = 'tuniu';


    public function getScenicQueryStrategy(): ScenicQueryFactoryInterface
    {
        $factory = new ScenicQueryFactory();
        return match ($this) {
            self::LOCAL  => $factory->LocalQuery(),
            self::TUNIU => $factory->TuniuQuery(),
        };
    }

    public function getScenicOrderStrategy(): ScenicOrderFactoryInterface
    {
        $factory = new ScenicOrderFactory();
        return match ($this) {
            self::TUNIU => $factory->TuniuOrder(),
        };
    }

}
